package tk.mybatis.springboot.model;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import tk.mybatis.mapper.util.StringUtil;
import tk.mybatis.springboot.share.util.PropertiesUtil;

public class ReinsuranceReqMsg implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 5497691341636710490L;

	private final String operType = "PMT";
	
	private String msg = "核保接口";
	
	private String sendTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
	
	private String sign = "";
	
	private Map<String, String> data = new HashMap<String, String>();

	private ReinsuranceReqMsg(){
		
	}
	
	public static ReinsuranceReqMsg buildMessage(String insurerCode, String bizID, Reinsurance reinsurance){
		ReinsuranceReqMsg msg = new ReinsuranceReqMsg();
		msg.data.put("applicationID", PropertiesUtil.getMessage("application_id"));
		msg.data.put("insurerCode", insurerCode);
		msg.data.put("bizID", bizID);
		msg.data.put("addresseeName", reinsurance.getAddresseeName());
		msg.data.put("addresseeDetails", reinsurance.getAddresseeDetails());
		msg.data.put("addresseeCounty", reinsurance.getAddresseeCounty());
		msg.data.put("addresseeCity", reinsurance.getAddresseeCity());
		msg.data.put("addresseeProvince", reinsurance.getAddresseeProvince());
		msg.data.put("addresseeMobile", reinsurance.getAddresseeMobile());
		msg.data.put("policyEmail", StringUtil.isEmpty(reinsurance.getPolicyEmail()) ? "1615134901@qq.com" : reinsurance.getPolicyEmail());
		return msg;
	}
	
	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public String getSendTime() {
		return sendTime;
	}

	public void setSendTime(String sendTime) {
		this.sendTime = sendTime;
	}

	public String getSign() {
		return sign;
	}

	public void setSign(String sign) {
		this.sign = sign;
	}

	public Map<String, String> getData() {
		return data;
	}

	public void setData(Map<String, String> data) {
		this.data = data;
	}

	public String getOperType() {
		return operType;
	}
}
